package com.wxg.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ResUtil {
	
	private static final String CONFIG_PATH = "props/EnglishWord.properties";

	public static String val(String key){
		String val = null;
		Properties prop = prop();
		if(null != prop){
			val = prop.getProperty(key);
		}
		return val;
	}
	
	public static Properties prop(){
		Properties prop = new Properties();
		InputStream is = ResUtil.class.getClassLoader().getResourceAsStream(CONFIG_PATH);
		try {
			try {
				prop.load(is);
			} finally {
				if(null != is){
					is.close();
				}
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		return prop;
	}
}
